var e = require;
var t = module;
var n = exports;
("use strict");
Object.defineProperty(n, "__esModule", { value: !0 }), (n.User = void 0);
(o.prototype.get = function (e) {
  return this.getData(e);
}),
  (o.prototype.set = function (e, t) {
    (this.data[e] = t), this.save();
  }),
  (o.prototype.getTempData = function (e) {
    return this.tempData[e];
  }),
  (o.prototype.setTempData = function (e, t) {
    this.tempData[e] = t;
  }),
  (o.prototype.save = function () {
    for (var e in this.data)
      cc.sys.localStorage.setItem(
        this.prefix + "_" + e,
        JSON.stringify(this.data[e])
      );
  }),
  (o.prototype.getData = function (t) {
    var e = this.data[t];
    if (void 0 !== e) return e;
    try {
      var n =
        JSON.parse(cc.sys.localStorage.getItem(this.prefix + "_" + t)) ||
        this.defaultData[t] ||
        null;
      return (this.data[t] = n);
    } catch (e) {
      return this.defaultData[t] || null;
    }
  }),
  (t = o);
function o() {
  (this.prefix = "walkFast"),
    (this.defaultData = {}),
    (this.data = {}),
    (this.tempData = {});
}
n.User = new t();
